//
//  ADStatusBottomView.swift
//  myBlog
//
//  Created by mac2014 on 16/3/28.
//  Copyright © 2016年 AD. All rights reserved.
//

import UIKit
//微博状态下的转发、评论以及赞按钮
class ADStatusBottomView: UIView {
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        prepareUI()
    }
    
    //MARK: - 自定义方法
    //footView界面设置
    func prepareUI() {
        //backgroundColor = UIColor.random()
        
        addSubview(retweetBtn)
        addSubview(commentBtn)
        addSubview(supportBtn)
        addSubview(seperatorFirst)
        addSubview(seperatorSecond)
        
        /// 转发按钮
        retweetBtn.snp_makeConstraints { (make) -> Void in
            make.leading.top.bottom.equalTo(self)
        }
        
        /// 评论按钮
        commentBtn.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(retweetBtn.snp_trailing)
            make.top.bottom.equalTo(self)
            
            // 宽度
            make.width.equalTo(retweetBtn)
        }
        
        /// 赞
        supportBtn.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(commentBtn.snp_trailing)
            make.top.trailing.bottom.equalTo(self)
            
            // 宽度
            make.width.equalTo(retweetBtn)
        }
        
        /// 分割线1
        seperatorFirst.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(retweetBtn.snp_trailing)
            make.centerY.equalTo(retweetBtn)
        }
        
        /// 分割线2
        seperatorSecond.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(commentBtn.snp_trailing)
            make.centerY.equalTo(commentBtn)
        }
        
        
    }
    
    
    
    //MARK: - 懒加载
    //转发
    lazy var retweetBtn: UIButton = {
        let btn = UIButton()
        btn.setTitle("转发", forState: UIControlState.Normal)
        btn.setImage(UIImage(named: "timeline_icon_retweet"), forState: UIControlState.Normal)
        return btn
    }()
    //评论
    lazy var commentBtn: UIButton = {
        let btn = UIButton()
        btn.setTitle("评论", forState: UIControlState.Normal)
        btn.setImage(UIImage(named: "timeline_icon_comment"), forState: UIControlState.Normal)
        return btn
    }()
    //赞
    lazy var supportBtn: UIButton = {
        let btn = UIButton()
        btn.setTitle("赞", forState: UIControlState.Normal)
        btn.setImage(UIImage(named: "timeline_icon_unlike"), forState: UIControlState.Normal)
        return btn
    }()
    //分割线一
    lazy var seperatorFirst: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    //分割线二
    lazy var seperatorSecond: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
}
